﻿<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="property" default-lazy="true" namespace="Cms.Domain" assembly="Cms.Domain">
  <class name="Folder" table="cmsFolder">
    <cache usage="read-write" />
    <id name="ID" type="System.Int32" unsaved-value="0">
      <column name="ID" />
      <generator class="identity" />
    </id>
    <property name="Name" type="System.String">
      <column name="Name" not-null="true" />
    </property>
    <property name="StartPublishing" type="System.Nullable`1[[System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <column name="StartPublishing" not-null="false" />
    </property>
    <property name="EndPublishing" type="System.Nullable`1[[System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <column name="EndPublishing" not-null="false" />
    </property>
    <bag cascade="save-update" inverse="true" name="SubFolders" mutable="true" order-by="Name">
      <cache usage="read-write" />
      <key>
        <column name="ParentID" />
      </key>
      <one-to-many class="Folder" />
    </bag>
    <bag cascade="save-update" inverse="true" name="Pages" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="FolderID" />
      </key>
      <one-to-many class="Page" />
    </bag>
    <bag name="Categories" table="cmsFolderCategory" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="FolderID" />
      </key>
      <many-to-many class="Category">
        <column name="CategoryID" />
      </many-to-many>
    </bag>
    <bag name="AllowedAdministratorGroups" table="cmsAdministratorGroupAllowedFolder" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="FolderID" />
      </key>
      <many-to-many class="AdministratorGroup">
        <column name="GroupID" />
      </many-to-many>
    </bag>
    <bag name="DeniedAdministratorGroups" table="cmsAdministratorGroupDeniedFolder" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="FolderID" />
      </key>
      <many-to-many class="AdministratorGroup">
        <column name="GroupID" />
      </many-to-many>
    </bag>
    <bag name="RequiredUserGroups" table="cmsFolderRequiredUserGroup" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="FolderID" />
      </key>
      <many-to-many class="UserGroup">
        <column name="GroupID" />
      </many-to-many>
    </bag>
    <bag name="DeselectedUserGroups" table="cmsFolderDeselectedUserGroup" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="FolderID" />
      </key>
      <many-to-many class="UserGroup">
        <column name="GroupID" />
      </many-to-many>
    </bag>
    <many-to-one class="Site" name="Site">
      <column name="SiteID" not-null="true" />
    </many-to-one>
    <many-to-one class="Folder" name="Parent">
      <column name="ParentID" />
    </many-to-one>
  </class>
</hibernate-mapping>